using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.UI;

namespace Gj
{
    public class CodeHelper : NodeHelper
    {
        public TextHelper[] textList;
        protected override BindDataType bindDataType => BindDataType.String;

        private string code;
        protected override void BindData(string s)
        {
            if (code == s) return;
            code = s;
            for (int i = 0; i < textList.Length; i++)
            {
                if (code.Length > i)
                {
                    textList[i].SetData(code.Substring(i, 1));
                }
                else
                {
                    textList[i].SetData("");
                }
            }
        }
    }
}